//***继承的学习***


class Animal {
    String name;

    public Animal(String name) {
        this.name = name;
    }

    public void eat() {
        System.out.println(name + " 正在吃东西");
    }
}

class Dog extends Animal {
    String breed;

    public Dog(String name, String breed) {
        super(name);
        this.breed = breed;
    }

    public void bark() {
        System.out.println(name + "（品种：" + breed + "）正在汪汪叫");
    }

    @Override
    public void eat() {
        System.out.println(name + "（品种：" + breed + "）正在啃骨头");
    }
}


public class jicheng {
    public static void main(String[] args) {
        Dog dog = new Dog("旺财", "金毛");
        System.out.println("狗的名字是：" + dog.name);
        dog.eat();
        dog.bark();
    }
}
